package com.example.importdata;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.widget.TextView;

public class Main3Activity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main3);

        TextView txtUserName = (TextView) findViewById(R.id.txt_UserName);
        TextView txtPassword = (TextView) findViewById(R.id.txt_Password);

        SharedPreferences sharedPreferences = getSharedPreferences("jzc", Context.MODE_PRIVATE);//创建SharedPreferences对象
        String userName = sharedPreferences.getString("username","");
        String password = sharedPreferences.getString("Password","");
        txtUserName.setText(userName);
        txtPassword.setText(password);
    }
}

